<f:view
		xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:a4j="http://richfaces.org/a4j"
		xmlns:rich="http://richfaces.org/rich"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:itdep="http://itdep.bsuir.by/jsf"
		xmlns:t="http://myfaces.apache.org/tomahawk"
		>
	<ui:decorate template="/facelets/template/mainTemplate.xhtml">
		<ui:define name="title">#{commonBundle.title}</ui:define>
		<ui:define name="center">
			<ui:decorate template="/facelets/template/centerTemplate.xhtml">
				<ui:param name="actionBean" value="#{contactBean}"/>
				<ui:define name="content">
					<a4j:form>
						<a4j:commandLink value="#{studentBundle.backToList}" action="#{studentBean.cancel}"
										 reRender="content"
										 immediate="true"/>
					</a4j:form>
					<h:panelGrid columns="2" width="100%" columnClasses="td1,td1">

						<ui:decorate template="/facelets/template/editSection.xhtml">
							<ui:param name="title" value="#{studentBundle.student}"/>
							<ui:param name="section" value="#{studentBean.fullNameES}"/>
							<ui:define name="view">

								<div class="graphicImageInList">
									<itdep:personPhoto personPhoto="#{studentBean.record.personPhoto}"/>
									<itdep:personPhotoEdit personPhoto="#{studentBean.record.personPhoto}"/>
								</div>

								<h:outputText value="#{personBundle.lastName}: " styleClass="requiredField"/>
								<h:outputText value="#{studentBean.record.lastName}"/><br/>

								<h:outputText value="#{personBundle.firstName}: " styleClass="requiredField"/>
								<h:outputText value="#{studentBean.record.firstName} "/><br/>

								<h:outputText value="#{personBundle.middleName}: " styleClass="requiredField"/>
								<h:outputText value="#{studentBean.record.middleName} "/><br/>

								<h:outputText value="#{personBundle.birthDate}: " styleClass="requiredField"/>
								<h:outputText value="#{studentBean.record.birthDate}">
									<f:convertDateTime pattern="dd.MM.yyyy" timeZone="EET"/>
								</h:outputText><br/>
							</ui:define>
							<ui:define name="changeName">
								<h:panelGrid id="changeLastName">
									<a4j:form>
										<a4j:commandLink value="#{commonBundle.changeLastName}"
														 action="#{studentBean.changeLastName}"
														 reRender="changeLastName"
														 rendered="#{studentBean.showChangeLastName}"
														 immediate="true"/>
									</a4j:form>
									<a4j:form>
										<h:panelGroup id="changeLastNamePanelGroup"
													  rendered="#{!studentBean.showChangeLastName}">
											<br/>
											<ui:decorate
													template="/facelets/template/student/eventReasonTemplate.xhtml">
												<ui:param name="event" value="#{studentBean.newSurnameEvent}"/>
											</ui:decorate>
											<h:outputText value="#{commonBundle.newSurname}"/>
											<rich:spacer width="55"/>
											<h:inputText value="#{studentBean.record.lastName}"/>
											<br/>
											<a4j:commandButton id="butSave" value="#{commonBundle.save}"
															   action="#{studentBean.saveChangeLastName}"/>
											<a4j:commandButton id="butCancel" value="#{commonBundle.cancel}"
															   action="#{studentBean.cancelChangeName}"
															   immediate="true"/>
										</h:panelGroup>
									</a4j:form>
								</h:panelGrid>
							</ui:define>
							<ui:define name="edit">
								<ui:decorate template="/facelets/template/person/nameEdit.xhtml">
									<ui:param name="idPrefix" value="#{student}"/>
									<ui:param name="person" value="#{studentBean.record}"/>
								</ui:decorate>
							</ui:define>
						</ui:decorate>

						<ui:decorate template="/facelets/template/editSection.xhtml">
							<ui:param name="title" value="#{studentBundle.student}"/>
							<ui:param name="section" value="#{studentBean.studentDepartmentES}"/>
							<ui:define name="view">
								<h:outputText value="#{departmentBundle.faculty}: " styleClass="requiredField"/>
								<itdep:entityOutput
										value="#{studentBean.record.studentGroup.specialization.speciality.faculty}"
										format="{i18n.shortName}" locale="#{translationBean.locale}"/><br/>

								<h:outputText value="#{departmentBundle.speciality}: " styleClass="requiredField"/>
								<itdep:entityOutput
										value="#{studentBean.record.studentGroup.specialization.speciality}"
										format="{i18n.shortName}" locale="#{translationBean.locale}"/><br/>

								<h:outputText value="#{studentBundle.course}: " styleClass="requiredField"/>
								<h:outputText value="#{studentBean.record.studentGroup.course}"/><br/>

								<h:outputText value="#{departmentBundle.studentGroup}: " styleClass="requiredField"/>
								<itdep:entityOutput value="#{studentBean.record.studentGroup}"
													format="{i18n.description}"
													locale="#{translationBean.locale}"/><br/>

								<h:outputText value="#{studentBundle.privacyNumber}: " styleClass="requiredField"/>
								<h:outputText value="#{studentBean.record.privacyNumber}"/><br/>

								<h:outputText value="#{studentBundle.bookNumber}: " styleClass="requiredField"/>
								<h:outputText value="#{studentBean.record.bookNumber}"/><br/>

								<h:outputText value="#{dictionaryBundle.educationForm}: " styleClass="requiredField"/>
								<itdep:entityOutput
										value="#{studentBean.record.studentGroup.specialization.speciality.educationForm}"
										format="{i18n.description}"
										locale="#{translationBean.locale}"/><br/>

								<h:outputText value="#{studentBundle.educationType}: " styleClass="requiredField"/>
								<itdep:entityOutput value="#{studentBean.record.educationType}"
													format="{i18n.description}"
													locale="#{translationBean.locale}"/><br/>

								<h:outputText value="#{studentBundle.studentPosition}: " styleClass="requiredField"/>
								<itdep:entityOutput value="#{studentBean.record.studentPosition}"
													format="{i18n.description}"
													locale="#{translationBean.locale}"/>
							</ui:define>
							<ui:define name="changePayment">
								<h:panelGrid id="changePayment">
									<a4j:form>
										<a4j:commandLink value="#{commonBundle.changePayment}"
														 action="#{studentBean.changePayment}"
														 reRender="changePayment"
														 rendered="#{studentBean.showChangePayment}"
														 immediate="true"/>
									</a4j:form>
									<a4j:form>
										<h:panelGroup id="changePaymentPanelGroup"
													  rendered="#{!studentBean.showChangePayment}">
											<ui:decorate
													template="/facelets/template/student/eventReasonTemplate.xhtml">
												<ui:param name="event" value="#{studentBean.changePaymentlEvent}"/>
											</ui:decorate>
											<h:outputText value="#{studentBundle.educationType}: "
														  styleClass="requiredField"/>
											<rich:spacer width="110"/>
											<itdep:entitySelectMenu value="#{studentBean.record.educationType}"
																	anyValue="true"
																	format="{i18n.description}"
																	entityType="education-type"
																	styleClass="sizeCopmonent"/>
											<rich:spacer/>
											<br/>
											<a4j:commandButton id="butSave" value="#{commonBundle.save}"
															   action="#{studentBean.saveChangePayment}"/>
											<a4j:commandButton id="butCancel" value="#{commonBundle.cancel}"
															   action="#{studentBean.cancelChangePayment}"
															   immediate="true"/>
										</h:panelGroup>
									</a4j:form>
								</h:panelGrid>
							</ui:define>
							<ui:define name="edit">
								<ui:decorate template="/facelets/template/student/studentDepartmentEdit.xhtml">
									<ui:param name="idPrefix" value="student"/>
									<ui:param name="student" value="#{studentBean}"/>
									<ui:param name="anyValue" value="true"/>
									<ui:define name="studentBookNumber">
										<ui:decorate template="/facelets/template/student/studentBookNumber.xhtml">
											<ui:param name="student" value="#{studentBean}"/>
											<ui:param name="anyValue" value="true"/>
											<ui:param name="idPrefix" value="studentBook"/>
										</ui:decorate>
									</ui:define>
								</ui:decorate>
								<h:panelGrid id="#{idPrefix}DepartmentEditPanel" columns="3" width="380px">
									<h:outputText value="#{studentBundle.educationType}: " styleClass="requiredField"/>
									<itdep:entitySelectMenu value="#{studentBean.record.educationType}" anyValue="true"
															format="{i18n.description}"
															entityType="education-type" styleClass="sizeCopmonent"/>
									<rich:spacer/>
								</h:panelGrid>
							</ui:define>
						</ui:decorate>
					</h:panelGrid>
					<ui:decorate template="/facelets/template/student/studentTabs.xhtml"/>

				</ui:define>
			</ui:decorate>
		</ui:define>
	</ui:decorate>

</f:view>